package cn.yunyichina.provider.hisiface.invoke.openservice;

import cn.yunyichina.provider.framework.dubbo.service.BaseService;
import cn.yunyichina.provider.hisiface.invoke.IOutsideInvoke;
import cn.yunyichina.provider.iface.entity.base.PatientInfoVoOut;
import cn.yunyichina.provider.iface.entity.common.ResCommon;
import cn.yunyichina.utils.convert.JsonUtils;
import com.alibaba.fastjson.JSON;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;
/**
 * Created by Administrator on 2017/8/16.
 */
public class PatientInfoModifyService implements IOutsideInvoke {

    static Logger logger = LoggerFactory.getLogger(PatientInfoModifyService.class);
    @Override
    public String execute(Map<String, String> params) {
        String paramsStr = JSON.toJSONString(params);
        logger.info("openService:PatientInfoModify 接收到前置机的入参: {}", paramsStr);
        PatientInfoVoOut infoVo = JsonUtils.parseObject(params, PatientInfoVoOut.class);
        ResCommon<Void> response = BaseService.getBaseClient().patientInfoModify(infoVo);
        String result = JsonUtils.toJsonString(response);
        logger.info("openService:PatientInfoModify 返回给前置机: {}", result);
        return result;
    }
}